home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / PInterfaces / Unmangler.p < prev    next >
Encoding:
Text File  |  1992-01-29  |  2.0 KB  |  69 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Wednesday, July 16, 1991 at 2:05 PM
  3.     Unmangler.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc. 1988-1991
  7.         All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Unmangler;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingUnmangler}
  21. {$SETC UsingUnmangler := 1}
  22.  
  23. {$I+}
  24. {$SETC UnmanglerIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingTypes}
  27. {$I $$Shell(PInterfaces)Types.p}
  28. {$ENDC}
  29. {$SETC UsingIncludes := UnmanglerIncludes}
  30.  
  31.         (*
  32.         FUNCTION unmangle(dst: UNIV Ptr; src: UNIV Ptr; limit: LongInt): LongInt; C;
  33.             {This function unmangles C++ mangled symbols (i.e. a symbol with a type signature).
  34.              The mangled C string is passed in “src” and the unmangled C string is returned in
  35.              “dst”.  Up to “limit” characters (not including terminating null) may be retured
  36.              in “dst”.
  37.          
  38.              The function returns,
  39.          
  40.                  -1 ==> error, probably because symbol was not mangled, but looked like it was
  41.                     0 ==> symbol wasn't mangled; not copied either
  42.                     1 ==> symbol was mangled; unmangled result fit in buffer
  43.                     2 ==> symbol was mangled; unmangled result truncated to fit in buffer}
  44.         *)
  45.         
  46.         FUNCTION Unmangle(dst: UNIV StringPtr; src: UNIV StringPtr; limit: LongInt): LongInt;
  47.             {This function unmangles C++ mangled symbols (i.e. a symbol with a type signature).
  48.              The mangled Pascal string is passed in “src” and the unmangled Pascal string is
  49.              returned in “dst”.  Up to “limit” characters may be retured in “dst”.
  50.             
  51.              The function returns,
  52.              
  53.                  -1 ==> error, probably because symbol was not mangled, but looked like it was
  54.                     0 ==> symbol wasn't mangled; not copied either
  55.                     1 ==> symbol was mangled; unmangled result fit in buffer
  56.                     2 ==> symbol was mangled; unmangled result truncated to fit in buffer
  57.                      
  58.              This function is identical to unmangle() above except that all the strings are
  59.              Pascal instead of C strings.
  60.             }
  61.  
  62.  
  63. {$ENDC}    { UsingUnmangler }
  64.  
  65. {$IFC NOT UsingIncludes}
  66.     END.
  67. {$ENDC}
  68.  
  69.